﻿@model JuCheap.Service.Dto.EmailPoolDto
@{
    ViewBag.Title = "Add";
    Layout = "~/Areas/Adm/Views/Shared/_Layout_Body.cshtml";
}
@section StylesBefore
{
    @Styles.Render("~/Template/Admin/jucheap/Css/Tags")
}

@section Scripts{
    @Scripts.Render("~/JS/Admin/jucheap/Tags")
    <script>
        $("#submitForm").validate({
            submitHandler: jucheap.buttonLoading,
            rules: {
                ReceiverEmails: {
                    required: true
                },
                Title: {
                    required: true,
                    minlength: 1,
                    maxlength: 100
                },
                Content: {
                    required: true,
                    minlength: 1,
                    maxlength: 8000
                }
            },
            messages: {
                ReceiverEmails: {
                    required: "请输入收件人邮箱地址"
                },
                Name: {
                    required: "请输入邮件主题",
                    minlength: "最小长度为1个字符",
                    maxlength: "最大长度为100个字符"
                },
                Description: {
                    required: "请输入邮件内容",
                    minlength: "最小长度为1个字符",
                    maxlength: "最大长度为8000个字符"
                }
            }
        });
        $('.popovers').popover();
    </script>
}

<div class="row">
    <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading">
                发送邮件
            </header>
            <div class="panel-body">
                <div class="form">
                    <form class="cmxform form-horizontal tasi-form" id="submitForm" method="POST" action="@Request.Url.PathAndQuery" novalidate="novalidate">
                        @Html.HiddenFor(item => item.Id, new { @class = "form-control" })

                        
                        <div class="form-group popovers" data-original-title="提示" data-content="邮件地址输入完成后按回车键，继续输入下一个" data-placement="bottom" data-trigger="hover">
                            @Html.LabelFor(item => item.ReceiverEmails, new { @class = "control-label col-lg-2" })
                            <div class="col-lg-10">
                                <input id="ReceiverEmails" name="ReceiverEmails" type="text" class="tags tags-input" data-type="tags" value=""  />
                            </div>
                        </div>


                        <div class="form-group ">
                            @Html.LabelFor(item => item.Title, new { @class = "control-label col-lg-2" })
                            <div class="col-lg-10">
                                @Html.TextBoxFor(item => item.Title, new { @class = "form-control" })
                            </div>
                        </div>

                        <div class="form-group ">
                            @Html.LabelFor(item => item.Content, new { @class = "control-label col-lg-2" })
                            <div class="col-lg-10">
                                @Html.TextAreaFor(item => item.Content, new { @class = "form-control" })
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-lg-offset-2 col-lg-10">
                                <button class="btn btn-success" type="submit">保存</button>
                                <button class="btn btn-default" type="button" onclick="jucheap.goback(this)">返回</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </section>
    </div>
</div>
